package com.ruoyi.organization.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.organization.mapper.BaseLocationMapper;
import com.ruoyi.organization.domain.BaseLocation;
import com.ruoyi.organization.service.IBaseLocationService;

/**
 * 办公地点Service业务层处理
 * 
 * @author hango
 * @date 2025-10-10
 */
@Service
public class BaseLocationServiceImpl implements IBaseLocationService 
{
    @Autowired
    private BaseLocationMapper baseLocationMapper;

    /**
     * 查询办公地点
     * 
     * @param id 办公地点主键
     * @return 办公地点
     */
    @Override
    public BaseLocation selectBaseLocationById(Long id)
    {
        return baseLocationMapper.selectBaseLocationById(id);
    }

    /**
     * 查询办公地点列表
     * 
     * @param baseLocation 办公地点
     * @return 办公地点
     */
    @Override
    public List<BaseLocation> selectBaseLocationList(BaseLocation baseLocation)
    {
        return baseLocationMapper.selectBaseLocationList(baseLocation);
    }

    /**
     * 新增办公地点
     * 
     * @param baseLocation 办公地点
     * @return 结果
     */
    @Override
    public int insertBaseLocation(BaseLocation baseLocation)
    {
        baseLocation.setCreateTime(DateUtils.getNowDate());
        return baseLocationMapper.insertBaseLocation(baseLocation);
    }

    /**
     * 修改办公地点
     * 
     * @param baseLocation 办公地点
     * @return 结果
     */
    @Override
    public int updateBaseLocation(BaseLocation baseLocation)
    {
        baseLocation.setUpdateTime(DateUtils.getNowDate());
        return baseLocationMapper.updateBaseLocation(baseLocation);
    }

    /**
     * 批量删除办公地点
     * 
     * @param ids 需要删除的办公地点主键
     * @return 结果
     */
    @Override
    public int deleteBaseLocationByIds(Long[] ids)
    {
        return baseLocationMapper.deleteBaseLocationByIds(ids);
    }

    /**
     * 删除办公地点信息
     * 
     * @param id 办公地点主键
     * @return 结果
     */
    @Override
    public int deleteBaseLocationById(Long id)
    {
        return baseLocationMapper.deleteBaseLocationById(id);
    }
}
